<template>
  <div class="container">
    <topTitle
      :titleText="titleText"
      :back="true"
      @gobackTriser="goBack"
    ></topTitle>
    <div class="mainCon">
      <div class="infoBox">
        <el-row class="elrow" type="flex">
          <el-col :span="6" class="desc elcol"><span>缴纳月份</span></el-col>
          <el-col :span="6" class="descValue elcol"
            ><span>{{ infoDetail.belongDate }}</span></el-col
          >
          <el-col :span="6" class="desc elcol"><span>险种类型</span></el-col>
          <el-col :span="6" class="descValue elcol"
            ><span>{{ infoDetail.socialType }}</span></el-col
          >
        </el-row>
        <el-row class="elrow" type="flex">
          <el-col :span="6" class="desc elcol"
            ><span>职工工资总额</span></el-col
          >
          <el-col :span="6" class="descValue elcol"
            ><span>{{ infoDetail.salaryTotal }}</span></el-col
          >
          <el-col :span="6" class="desc elcol"
            ><span>单位缴费基数</span></el-col
          >
          <el-col :span="6" class="descValue elcol"
            ><span>{{ infoDetail.payTotal }}</span></el-col
          >
        </el-row>
        <el-row class="elrow" type="flex">
          <el-col :span="6" class="desc elcol"
            ><span>单位缴纳人数</span></el-col
          >
          <el-col :span="6" class="descValue elcol"
            ><span>{{ infoDetail.payPeople }}</span></el-col
          >
          <el-col :span="6" class="desc elcol"
            ><span>当月应缴金额</span></el-col
          >
          <el-col :span="6" class="descValue elcol"
            ><span>{{ infoDetail.shouldPay }}</span></el-col
          >
        </el-row>
        <el-row class="elrow" type="flex">
          <el-col :span="6" class="desc elcol"
            ><span>当月实缴金额</span></el-col
          >
          <el-col :span="6" class="descValue elcol"
            ><span>{{ infoDetail.actPay }}</span></el-col
          >
          <el-col :span="6" class="desc elcol"><span>缴纳日期</span></el-col>
          <el-col :span="6" class="descValue elcol"
            ><span>{{ infoDetail.payDate }}</span></el-col
          >
        </el-row>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'socialInsurenceDetail',
  data() {
    return {
      titleText: '社会保险',
      infoDetail: {},
    }
  },
  async mounted() {
    const { id } = this.$route.query
    await this.getInfoDetail(id)
  },
  methods: {
    // 信息详情
    getInfoDetail(id) {
      return this.axios({
        method: 'post',
        url: 'api-c/companySocialSecurity/base/detail',
        data: {
          id,
        },
      })
        .then((response) => {
          if (!response.data.hasError) {
            this.infoDetail = response.data.result
          } else {
            this.$message.error(response.data.errorMsg)
          }
        })
        .catch((error) => {
          if (error.response) {
            this.$message.error(error.response.data)
          }
        })
    },
    //返回
    goBack() {
      const { companyId, companyName, uscc } = this.$route.query
      this.$router.push({
        path: '/home/enterpriseArchives/enterpriseData',
        name: 'enterpriseData',
        query: {
          activeName: 'third',
          companyId,
          companyName,
          uscc,
        },
      })
      this.$store.commit('GOBACK_NAME', {
        oldUrl: '/home/enterpriseArchives/enterpriseList',
        newUrl: this.$router.currentRoute.fullPath,
      })
    },
  },
}
</script>

<style lang="less" scoped>
.container {
  .mainCon {
    height: calc(100% - 67px);
    overflow-y: auto;
    padding: 24px;
    background: #f5f7fa;
    .infoBox {
      height: 100%;
      padding: 24px 30px;
      background-color: #fff;
      .elrow {
        .elcol {
          display: table;
          padding: 12px;
          height: 60px;
          text-align: center;
          border-top: 1px solid #777;
          border-left: 1px solid #777;
          &:last-child {
            border-right: 1px solid #777;
          }
          span {
            display: table-cell;
            vertical-align: middle;
            line-height: 20px;
          }
        }
        .desc {
          background-color: #eee;
        }
        &:last-child {
          border-bottom: 1px solid #777;
        }
      }
    }
  }
}
</style>
